R you ready to ggplot?

Overview
October 15, 2014

Tony Fujs

Dataviz tools?

WHY USE R & ggplot2?

  • Flexible
  • Powerful

WHY USE R & ggplot2?

WHY USE R & ggplot2?

WHY USE R & ggplot2?

WHY USE R & ggplot2?

WHY USE R & ggplot2?

  • Flexible
  • Powerful
  • Scaling

Difference between this plot...

and this plot?

ONE LINE OF CODE!!

facet_wrap(~year)

WHY USE R & ggplot2?

  • Flexible
  • Powerful
  • Scaling
  • Reproducible work

WHY USE R & ggplot2?

  • Flexible
  • Powerful
  • Scaling
  • Reproducible work
  • Building block for other tools (ggvis, ggmap)

What is ggplot2?

  • R package (An app for your smaRt phone)
  • Rely on the Grammar of Graphics (gg)

Barriers to entry

  • R: From point & click to writing code
  • Learning Grammar of Graphics (gg) - as opposed to typology (list of charts)

Objective of the workshop

Remove those barriers

  • Understand the gg framework
  • Play with simple code

How do we do it?

  1. gg theory

How do we do it?

  1. gg theory
  2. create simple plots

How do we do it?

  1. gg theory
  2. create simple plots
  3. create complex plot(s)

Napoleon's Russian Campaign: Original

Small multiples: Walmart stores